package com.moyangfenghun.javabase.model;

import com.fasterxml.jackson.annotation.JsonView;
import com.moyangfenghun.javabase.bean.vo.SysUserView;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;

import java.time.LocalDateTime;

/**
 * 系统用户表 实体类。
 *
 * @author yt
 * @since 0.1
 */
@Data
@Schema(name = "系统用户表")
@Table(value = "sys_user")
@JsonView(value = SysUserView.All.class)
public class SysUserEntity {

    /**
     * ID
     */
    @JsonView(value = SysUserView.Public.class)
    @Schema(description = "ID")
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 用户名
     */
    @JsonView(value = SysUserView.Public.class)
    @Schema(description = "用户名")
    @Column(value = "username")
    private String username;

    /**
     * 创建时间
     */
    @JsonView(value = SysUserView.Public.class)
    @Schema(description = "创建时间")
    @Column(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 状态
     */
    @JsonView(value = SysUserView.Public.class)
    @Schema(description = "状态")
    @Column(value = "status")
    private Integer status;

    /**
     * 密码
     */
    @JsonView(value = SysUserView.Internal.class)
    @Schema(description = "密码")
    @Column(value = "password")
    private String password;

    /**
     * 离职日期
     */
    @JsonView(value = SysUserView.Public.class)
    @Schema(description = "离职日期")
    private LocalDateTime dimissionTime;
}
